package com.zhiyou100.unit;

public class Page {
    private int pageSize;
    private int pageNo;
    private int total;
    private int pageTotal;
    private int startNum;

    public int  getStartNum(int pageNo,int pageSize  ){
          startNum = (pageNo-1)*pageSize;
        return startNum;
    }
    public int  getPageTotal(int total,int pageSize  ){

        if (total%pageSize == 0){ //如果余数等于0，那么总页数就是商
            pageTotal = total/pageSize;
        }else {                     //否则总页数就是商+1
            pageTotal = total/pageSize+1;
        }
        return pageTotal;
    }


}
